home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 2.6 KB | 113 lines | [TEXT/MPS ] |
- // UFileStream.h
- // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
- // Originally written by Larry S. Rosenstein. Used by permission
-
-
- #ifndef __UFILESTREAM__
- #define __UFILESTREAM__
-
- // MacApp
-
- #ifndef __GEOMETRY__
- #include "Geometry.h"
- #endif
-
- #ifndef __TOOLBOX__
- #include "Toolbox.h"
- #endif
-
- #ifndef __UGEOMETRY__
- #include "UGeometry.h"
- #endif
-
- #ifndef __UOBJECT__
- #include "UObject.h"
- #endif
-
- #ifndef __USTREAM__
- #include "UStream.h"
- #endif
-
- // Toolbox
-
-
- //----------------------------------------------------------------------------------------
- // Forward class declarations.
- //----------------------------------------------------------------------------------------
-
- class TFile;
- class TList;
-
- //----------------------------------------------------------------------------------------
- // TFileStream: This implements a stream on a file. The client is responsible for opening
- // and closing the file.
- //----------------------------------------------------------------------------------------
-
- class TFileStream : public TStream
- {
- MA_DECLARE_CLASS;
-
- public:
- TFile* fFile;
-
- //------------------------------------------------------------------------------------
- // Creation/Destruction
- //------------------------------------------------------------------------------------
-
- TFileStream();
- // Constructor
- virtual ~TFileStream();
- // Destructor
-
- void IFileStream(TFile* itsFile);
-
-
- //------------------------------------------------------------------------------------
- // SubClass Implementations
- //------------------------------------------------------------------------------------
-
- virtual long GetPosition();
-
- virtual void SetPosition(long newPosition);
-
- virtual long GetSize();
-
- virtual void SetSize(long newSize);
-
- virtual void ReadBytes(void* p, long count);
-
- virtual void WriteBytes(const void* p, long count);
-
- };
-
-
- //----------------------------------------------------------------------------------------
- // TFileResourceStream: This implements a stream that reads and writes to partial resources.
- // Since the partial resources traps are only available in System 7, this stream class can
- // only be used under System 7.
- //----------------------------------------------------------------------------------------
-
- class TFileResourceStream : public TResourceStream
- {
- MA_DECLARE_CLASS;
-
- public:
- TFile* fFile;
-
- TFileResourceStream();
- virtual ~TFileResourceStream();
- // Destructor
-
- virtual void IFileResourceStream( TFile* theFile,
- ResType theType, ResNumber theID);
-
- virtual void WriteBytes(const void* p, long count);
-
- virtual void ReadBytes(void* p, long count);
-
- virtual void SetSize(long newSize);
- };
-
-
- #endif // __UFILESTREAM__
-